package com.lx.rpc.provider;

import com.lx.rpc.framework.protocol.Protocol;
import com.lx.rpc.framework.protocol.URL;
import com.lx.rpc.framework.protocol.factory.ProtocolFactory;
import com.lx.rpc.framework.register.LocalRegister;
import com.lx.rpc.provider.api.UserService;
import com.lx.rpc.provider.impl.UserServiceImpl;

/**
 * 生产者启动
 * @author wcy
 */
public class ProviderApplication {


    public static void main(String[] args) {


        //本地注册
        LocalRegister.register(UserService.class.getName(), UserServiceImpl.class);
        URL url = new URL("localhost", 8080);
        //获取配置的协议
        Protocol protocol = ProtocolFactory.getProtocol();
        //启动应用
        protocol.start(url);


    }


}
